package com.ssyx.acl.controller;

import com.ssyx.common.result.Result;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

/**
 * ClassName:IndexController
 * Description:
 *
 * @Author kay
 * @Create 2024/4/22 20:50
 * @Version 1.0
 */
@Tag(name = "登录接口")
@RestController
@RequestMapping("/admin/acl/index")
//@CrossOrigin //跨域
public class IndexController {

    @Operation(summary = "登录")
    @PostMapping("login")
    public Result login(){
        //返回token值
        Map<String , String> map = new HashMap<>();
        map.put("token","token-admin");
        return Result.ok(map);
    }


    @Operation(summary = "获取用户信息")
    @GetMapping("info")
    public Result info(){
        Map<String,String> map = new HashMap<>();
        map.put("name","admin");
        map.put("avatar","https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
        return Result.ok(map);
    }


    @Operation(summary = "退出")
    @PostMapping("logout")
    public Result logout(){
        return Result.ok(null);
    }
}
